home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / include / you.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-01  |  6.9 KB  |  216 lines  |  [TEXT/R*ch]

  1. /*    SCCS Id: @(#)you.h    3.1    93/07/07    */
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifndef YOU_H
  6. #define YOU_H
  7.  
  8. #ifndef ALIGN_H
  9. #include "align.h"
  10. #endif
  11. #ifndef ATTRIB_H
  12. #include "attrib.h"
  13. #endif
  14. #ifndef MONST_H
  15. #include "monst.h"
  16. #endif
  17. #ifndef YOUPROP_H
  18. #include "youprop.h"
  19. #endif
  20.  
  21. struct prop {
  22.  
  23. #define TIMEOUT        007777    /* mask */
  24.  
  25. #define LEFT_RING    W_RINGL    /* 010000L */
  26. #define RIGHT_RING    W_RINGR    /* 020000L */
  27. #define LEFT_SIDE    LEFT_RING
  28. #define RIGHT_SIDE    RIGHT_RING
  29. #define BOTH_SIDES    (LEFT_SIDE | RIGHT_SIDE)
  30.  
  31. #define WORN_ARMOR    W_ARM    /* 040000L */
  32. #define WORN_CLOAK    W_ARMC    /* 0100000L */
  33. #define WORN_HELMET    W_ARMH    /* 0200000L */
  34. #define WORN_SHIELD    W_ARMS    /* 0400000L */
  35. #define WORN_GLOVES    W_ARMG    /* 01000000L */
  36. #define WORN_BOOTS    W_ARMF    /* 02000000L */
  37. #define WORN_AMUL    W_AMUL    /* 04000000L */
  38. #define WORN_BLINDF    W_TOOL    /* 010000000L */
  39. #ifdef TOURIST
  40. #define WORN_SHIRT    W_ARMU    /* 01000L */
  41. #endif
  42.  
  43. /*
  44.  * FROMEXPER is for a property gained by virtue of your experience level,
  45.  * which will be lost if you lose that level; FROMOUTSIDE is one that is
  46.  * gained in some other way (e.g., a throne, a prayer, or a corpse).
  47.  * INTRINSIC is either FROMEXPER or FROMOUTSIDE
  48.  */
  49. #define FROMOUTSIDE    0200000000L
  50. #define FROMEXPER    0400000000L
  51. #define INTRINSIC    (FROMOUTSIDE|FROMEXPER)
  52.  
  53.     long p_flgs;
  54. };
  55.  
  56. struct u_have {
  57.     Bitfield(amulet,1);    /* carrying Amulet    */
  58.     Bitfield(bell,1);    /* carrying Bell    */
  59.     Bitfield(book,1);    /* carrying Book    */
  60.     Bitfield(menorah,1);    /* carrying Candelabrum */
  61. #ifdef MULDGN
  62.     Bitfield(questart,1);    /* carrying the Quest Artifact */
  63.     Bitfield(unused,3);
  64. #else
  65.     Bitfield(unused,4);
  66. #endif
  67. };
  68.  
  69. struct u_event {
  70.     Bitfield(minor_oracle,1);    /* received at least 1 cheap oracle */
  71.     Bitfield(major_oracle,1);    /*  "  expensive oracle */
  72. #ifdef MULDGN
  73.     Bitfield(qcalled,1);        /* called by Quest leader to do task */
  74.     Bitfield(qexpelled,1);        /* expelled from the Quest dungeon */
  75.     Bitfield(qcompleted,1);        /* successfully completed Quest task */
  76. #endif
  77.     Bitfield(uheard_tune,2);    /* 1=know about, 2=heard passtune */
  78.     Bitfield(uopened_dbridge,1);    /* opened the drawbridge */
  79.     Bitfield(invoked,1);        /* invoked Gate to the Sanctum level */
  80.  
  81.     Bitfield(gehennom_entered,1);    /* entered Gehennom via Valley */
  82. #ifdef ELBERETH
  83.     Bitfield(uhand_of_elbereth,2);    /* became Hand of Elbereth */
  84. #endif
  85.     Bitfield(udemigod,1);        /* killed the wiz */
  86.     Bitfield(ascended,1);        /* has offered the Amulet */
  87. };
  88.  
  89.  
  90. struct you {
  91.     xchar ux, uy;
  92.     schar dx, dy, dz;    /* direction of move (or zap or ... ) */
  93.     schar di;        /* direction of FF */
  94.     xchar ux0, uy0;        /* initial position FF */
  95.     d_level uz, uz0;    /* your level on this and the previous turn */
  96.     d_level utolev;        /* level monster teleported you to, or uz */
  97.     char utotype;        /* bitmask of goto_level() flags for utolev */
  98.     char usym;        /* usually '@' */
  99.     boolean umoved;        /* changed map location (post-move) */
  100.     int last_str_turn;    /* 0: none, 1: half turn, 2: full turn */
  101.                 /* +: turn right, -: turn left */
  102.     unsigned ulevel;    /* 1 - MAXULEV */
  103.     unsigned utrap;        /* trap timeout */
  104.     unsigned utraptype;    /* defined if utrap nonzero */
  105. #define TT_BEARTRAP    0
  106. #define TT_PIT        1
  107. #define TT_WEB        2
  108. #define TT_LAVA        3
  109. #define TT_INFLOOR    4
  110.     char    urooms[5];    /* rooms (roomno + 3) occupied now */
  111.     char    urooms0[5];    /* ditto, for previous position */
  112.     char    uentered[5];    /* rooms (roomno + 3) entered this turn */
  113.     char    ushops[5];    /* shop rooms (roomno + 3) occupied now */
  114.     char    ushops0[5];    /* ditto, for previous position */
  115.     char    ushops_entered[5]; /* ditto, shops entered this turn */
  116.     char    ushops_left[5];    /* ditto, shops exited this turn */
  117.  
  118.     int     uhunger;    /* refd only in eat.c and shk.c */
  119.     unsigned uhs;        /* hunger state - see eat.c */
  120.  
  121.     struct prop uprops[LAST_PROP+1];
  122.  
  123.     unsigned umconf;
  124.     const char *usick_cause;
  125. /* For messages referring to hands, eyes, feet, etc... when polymorphed */
  126. #define ARM 0
  127. #define EYE 1
  128. #define FACE 2
  129. #define FINGER 3
  130. #define FINGERTIP 4
  131. #define FOOT 5
  132. #define HAND 6
  133. #define HANDED 7
  134. #define HEAD 8
  135. #define LEG 9
  136. #define LIGHT_HEADED 10
  137. #define NECK 11
  138. #define SPINE 12
  139. #define TOE 13
  140.  
  141.     /* These ranges can never be more than MAX_RANGE (vision.h). */
  142.     int nv_range;            /* current night vision range */
  143.     int xray_range;            /* current xray vision range */
  144.  
  145.     /*
  146.      * These variables are valid globally only when punished and blind.
  147.      */
  148. #define BC_BALL  0x01    /* bit mask for ball  in 'bc_felt' below */
  149. #define BC_CHAIN 0x02    /* bit mask for chain in 'bc_felt' below */
  150.     int bglyph;    /* glyph under the ball */
  151.     int cglyph;    /* glyph under the chain */
  152.     int bc_order;    /* ball & chain order [see bc_order() in ball.c] */
  153.     int bc_felt;    /* mask for ball/chain being felt */
  154.  
  155.  
  156.     /*
  157.      * Player type monster (e.g. PM_VALKYRIE).  This is set in u_init
  158.      * and never changed afterward.
  159.      */
  160.     int umonster;
  161. #ifdef POLYSELF
  162.     int umonnum;                /* monster number or -1 */
  163.     int mh, mhmax, mtimedone;        /* for polymorph-self */
  164.     struct attribs    macurr,            /* for monster attribs */
  165.             mamax;            /* for monster attribs */
  166.     int ulycn;                /* lycanthrope type */
  167. #endif
  168.     unsigned ucreamed;
  169.     unsigned uswldtim;        /* time you have been swallowed */
  170.  
  171.     Bitfield (uswallow,1);        /* true if swallowed */
  172.     Bitfield(uinwater,1);        /* if you're currently in water (only
  173.                        underwater possible currently) */
  174. #ifdef POLYSELF
  175.     Bitfield(uundetected,1);    /* if you're a hiding monster/piercer */
  176.     Bitfield(mfemale,1);        /* saved human value of flags.female */
  177. #endif
  178.     Bitfield(uinvulnerable,1);    /* you're invulnerable (praying) */
  179.     Bitfield(usleep,1);        /* you're sleeping */
  180.  
  181.     unsigned udg_cnt;        /* how long you have been demigod */
  182.     struct u_event    uevent;        /* certain events have happened */
  183.     struct u_have    uhave;        /* you're carrying special objects */
  184.     struct attribs    acurr,        /* your current attributes (eg. str)*/
  185.             aexe,        /* for gain/loss via "exercise" */
  186.             abon,        /* your bonus attributes (eg. str) */
  187.             amax,        /* your max attributes (eg. str) */
  188.             atemp,        /* used for temporary loss/gain */
  189.             atime;        /* used for loss/gain countdown */
  190.     align    ualign;            /* character alignment */
  191. #define CONVERT        2
  192.     aligntyp ualignbase[CONVERT];    /* for ualign conversion record */
  193.     schar uluck, moreluck;        /* luck and luck bonus */
  194. #define LUCKADD        3    /* added value when carrying luck stone */
  195. #define Luck    (u.uluck + u.moreluck)
  196. #define LUCKMAX        10    /* on moonlit nights 11 */
  197. #define LUCKMIN        (-10)
  198.     schar    udaminc;
  199.     schar    uac;
  200.     int    uhp,uhpmax;
  201.     int    uen, uenmax;        /* magical energy - M. Stephenson */
  202.     int ugangr;            /* if the gods are angry at you */
  203.     int ublessed, ublesscnt;    /* blessing/duration from #pray */
  204.     long    ugold, ugold0;
  205.     long    uexp, urexp;
  206.     long    ucleansed;    /* to record moves when player was cleansed */
  207.     int uinvault;
  208.     struct monst *ustuck;
  209.     int    umortality;        /* how many times you died */
  210.     int ugrave_arise; /* you die and become something aside from a ghost */
  211.     int nr_killed[NUMMONS];        /* used for experience bookkeeping */
  212.     time_t    ubirthday;        /* real world time when game began */
  213. };
  214.  
  215. #endif    /* YOU_H */
  216.